#! /usr/bin/python

import mathex

def decrypt(key, s):
    lk = len(key)
    index = 0
    ret = []
    while index+lk < len(s):
        for i,k in enumerate(key):
            ret.append(k^s[index+i])
        index += lk
    #the remain
    i = 0
    while index+i < len(s):
        ret.append(key[i]^s[index+i])
        i+=1
    return ret
def tostring(s):
    return ''.join([chr(k) for k in s])
def isEng(s):
    if s.find(' is ') >=0 \
       and s.find(' of ') >=0 \
       and s.find(' the ') >=0:
        return True
    else:
        return False
def main():
    s = [int(c) for c in open('cipher1.txt').read().split(',')]
    for a in range(ord('a'),ord('z')+1):
        for b in range(ord('a'),ord('z')+1):
            for c in range(ord('a'),ord('z')+1):
                o = decrypt([a,b,c], s)
                if isEng(tostring(o)):
                    print a,b,c
                    print tostring(o)
                    print sum(o)
                    print o
                    return

if __name__ == '__main__':
    main()
